package controllers

import (
	"github.com/goravel/framework/contracts/http"
	httpfacades "github.com/hulutech-web/http_result"
	"goravel/app/models"
)

type DevicestateController struct {
	//Dependent services
}

func NewDevicestateController() *DevicestateController {
	return &DevicestateController{
		//Inject services
	}
}

func (r *DevicestateController) Index(ctx http.Context) http.Response {
	devicestates := []models.Devicestate{}
	queries := ctx.Request().Queries()
	result, _ := httpfacades.NewResult(ctx).SearchByParams(queries, map[string]interface{}{}).ResultPagination(&devicestates, []string{"Device"}...)
	return result
}
